// /////////////////////////////////////////////////////////////////////////////
//
// Name:            ColourFrame.h
// Author:          Michael Bartsch
//
// Desc :           The interface for the CColourFrame class.
//
// License:         Copyright (C) 2008-2009 Michael Bartsch
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the GNU General Public
//                  License as published by the Free Software Foundation,
//                  either version 3 of the License, or (at your option) any
//                  later version.
//
//                  This program is distributed in the hope that it will be
//                  useful, but WITHOUT ANY WARRANTY; without even the implied
//                  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//                  PURPOSE. See the GNU General Public License for more
//                  details.
//
//                  You should have received a copy of the GNU General Public
//                  License along with this program. If not, see
//                  <http://www.gnu.org/licenses/>.
//
// /////////////////////////////////////////////////////////////////////////////

#ifndef __C_COLOURFRAME_H_INCLUDED__
#define __C_COLOURFRAME_H_INCLUDED__

// Include required header file(s).
#include "../../App.h"

#include "../MainFrame.h"
#include "../CameraPanel.h"
#include "./CubePanel.h"
#include "./RGBPanel.h"

#include "../../../Engine/ColourAnalyser.h"


// Forward Declarations.
class CMainFrame;
class CCameraPanel;
class CCubePanel;
class CRGBPanel;
class CColourAnalyser;

// Enumerations.
//! Widget ID's
enum COF_WidgetIDs
{
    COF_EnableTarget = 200,
    COF_TargetR,
    COF_TargetG,
    COF_TargetB,
    COF_TargetMargin,
    COF_TargetBorder
};


// The CColourFrame class.
//! Frame which is responsible for outputing the colour analysis.
class CColourFrame : public wxFrame
{
public:

    //! Constructor
    //! @param parent The window parent.
    CColourFrame(wxWindow *parent);

    //! Updates the frame and its children.
    void update();

    // Event functions.
    //! Handles the close event.
    void onClose(wxCloseEvent &event);
    //! Handles the "Quit" event of the "File" menu.
    void onQuit(wxCommandEvent &event);

    //! Handles events for the "Enable target" widget.
    void onEnableTarget(wxCommandEvent &event);
    //! Handles events for the "Target R" widget.
    void onTargetRChange(wxSpinEvent &event);
    //! Handles events for the "Target G" widget.
    void onTargetGChange(wxSpinEvent &event);
    //! Handles events for the "Target B" widget.
    void onTargetBChange(wxSpinEvent &event);
    //! Handles events for the "Target Margin" widget.
    void onTargetMarginChange(wxSpinEvent &event);
    //! Handles events for the "Target Border" widget.
    void onTargetBorderChange(wxSpinEvent &event);


private:

    // Internal
    CMainFrame *frameParent;
    CColourAnalyser *pColourAnalyser;

    // wxWidgets
    wxAuiManager frameManager;

    CCameraPanel *cameraPanel;
    CCubePanel *cubePanel;
    CRGBPanel *colourPanelR, *colourPanelG, *colourPanelB;

    wxCheckBox *enableTarget;
    wxSpinCtrl *targetR, *targetG, *targetB;
    wxSpinCtrl *targetMargin, *targetBorder;

    DECLARE_EVENT_TABLE()
};

#endif
